// ****************Fifo.h********
//   Header file for the FIFO for the 9S12
// Jonathan W. Valvano 1/27/09

//  This example accompanies the books
//   "Embedded Microcomputer Systems: Real Time Interfacing",
//         Engineering, copyright (c) 2006,
//   "Introduction to Embedded Microcomputer Systems: 
//    Motorola 6811 and 6812 Simulation", Thomson, copyright (c) 2002

// Copyright 2009 by Jonathan W. Valvano, valvano@mail.utexas.edu 
//    You may use, edit, run or distribute this file 
//    as long as the above copyright notice remains 

#define FIFOSIZE 50
/* Number of 16-bit values in the Fifo
     the FIFO is full when it has FifoSize-1 values */
     
     

/*-----------------------Fifo_Init----------------------------
  Initialize fifo to be empty
  Inputs: none
  Outputs: none */
void Accel_Fifo_Init(void);

/*-----------------------Fifo_Put----------------------------
  Enter one character into the fifo
  Inputs: 16-bit data
  Outputs: true if data is properly saved
  Since this is called by interrupt handlers no sei,cli*/
unsigned short Accel_Fifo_Put(unsigned short data);

/*-----------------------Fifo_Get----------------------------
  Remove one character from the fifo
  Inputs: pointer to place to save 16-bit data
  Outputs: true if data is valid */
unsigned short Accel_Fifo_Get(unsigned short *datapt);





